//
//  Playground.m
//  YouthOlympic2014
//
//  Created by xiangpaopao on 14-6-25.
//  Copyright (c) 2014年 mitian. All rights reserved.
//

#import "Playground.h"
#import "PlaygroundCategory.h"

@implementation Playground



+ (NSArray*)defaultPlaygroundCategories{
    NSString* plistFile = [[NSBundle mainBundle] pathForResource:@"DefaultPlaygrounds" ofType:@"plist"];
    NSArray* playgroundsSource = [[NSArray alloc] initWithContentsOfFile:plistFile];
    NSMutableArray* playgrounds = [NSMutableArray array];
    for (NSDictionary* playgroundDict in playgroundsSource) {
        PlaygroundCategory* playground = [[PlaygroundCategory alloc] initWithDictionary:playgroundDict];
        [playgrounds addObject:playground];
    }
    return playgrounds;
}


- (id)initWithDictionary:(NSDictionary*)matchDict{
    self = [super init];
    if (nil == self) {
        return nil;
    }

    self.playgroundId = [matchDict objectForKey:@"id"];
    self.location = [matchDict objectForKey:@"location"];
    self.title = [matchDict objectForKey:@"title"];
    
    return self;
}


@end
